home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigantic Games 2
/
Gigantic Games 2.iso
/
pc
/
_m_
/
minesweeper
/
mine.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-12-23
|
3KB
|
80 lines
// This may look like C code, but it is really -*- C++ -*-
///////////////////////////////////////////////////////////////////////////
//
// AMIGA Minesweeper - Global definitions
//
// (c) 1992 Hubert Feyrer (c9020@rrzc1.rz.uni-regensburg.de)
//
///////////////////////////////////////////////////////////////////////////
#ifndef _MINE_H
#define _MINE_H
#define WIN_T "AMIGA Minesweeper V0.98"
enum GameStat { GAME_WON, GAME_LOST, GAME_QUIT, GAME_RESTART, GAME_CONT };
class Field;
struct Offset {
int dx;
int dy;
};
extern "C" {
struct VisualInfo *vinfo;
struct IntuiBase *IntuitionBase;
struct GraphBase *GfxBase;
struct Library *GadToolsBase;
struct Window *win;
struct Gadget *glist;
struct Screen *scr;
struct timerequest treq; // Für Spielzeit-Anfrage
struct MsgPort *tport; // -"- ----"---- ---"---
};
extern int fxs; // field x size
extern int fys; // field y size
extern Field ***minefield; // Das Minenfeld!
extern int X0; // X-Offset
extern int Y0; // Y-Offset
extern int win_w; // Fensterhöhe
extern int win_h; // Fensterbreite
extern int lenx; // Feldgröße
extern int leny; // Feldgröße
extern int playtime; // Verspielte Zeit in Sekunden
extern int minesleft; // Anzahl unentdeckter Minen
extern Gadget *numgad; // Textgadget, um Restminen anzuzeigen
extern char tnumgad[5]; // minesleft
extern Gadget *timegad; // Um Spielzeit anzuzeigen
extern char ttimegad[5]; // playtime
extern Gadget *gogad; // Restart-Button
extern char *argv0; // Programmname
extern Offset validfields[8]; // Mögliche Nachbarfelder
extern int countdown; // Nach zu markieren/aufdeckende Felder
/*
** in init.cc
*/
void init(int p);
void shutdown(int rc, char *msg=NULL);
void showmines(void);
void calc_cnt(void);
int rnd(int high);
void hidemines(int p);
void removemines(void);
/*
** in mine.cc
*/
void game_won(void);
void game_lost(void);
inline int inminefield(int i, int j){ return (i>=0 && j>=0 && i<lenx && j<leny); }
int main(int argc, char *argv[]);
/*
** in play.cc
*/
GameStat play(int idle);
#endif /* _MINE_H */